export default{
    namespaced:true,
    state:{
        historyAry:JSON.parse(localStorage.getItem('history')||'[]')
    },
    mutations:{
        ADD_TABS(state,payload){
            let result=state.historyAry.find(item=>item.title===payload.title)
            if(!result){
                state.historyAry.push(payload)
            }
            localStorage.setItem('history',JSON.stringify(state.historyAry))
        },
        REMOVE_TABS(state,payload){
            state.historyAry=state.historyAry.filter(item=>item.title!=payload)
            localStorage.setItem('history',JSON.stringify(state.historyAry))
            
        }
    }   
}